home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 July / Chip_2000-07_cd.bin / sharewar / vbshpdfc / Install.exe / VB Shaped Form Creator.CAB / About1.frm < prev    next >
Text File  |  2000-04-13  |  12KB  |  271 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  3. Begin VB.Form frmAbout 
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "About VBSFC FormAnimator"
  6.    ClientHeight    =   3000
  7.    ClientLeft      =   4500
  8.    ClientTop       =   3000
  9.    ClientWidth     =   3000
  10.    ControlBox      =   0   'False
  11.    MaxButton       =   0   'False
  12.    Picture         =   "About1.frx":0000
  13.    ScaleHeight     =   3000
  14.    ScaleWidth      =   3000
  15.    Begin VB.CommandButton cmdOK 
  16.       Cancel          =   -1  'True
  17.       Caption         =   "OK"
  18.       Default         =   -1  'True
  19.       Height          =   315
  20.       Left            =   1080
  21.       TabIndex        =   0
  22.       Top             =   2280
  23.       Width           =   795
  24.    End
  25.    Begin VB.Timer tmrAnimate 
  26.       Interval        =   50
  27.       Left            =   300
  28.       Top             =   2460
  29.    End
  30.    Begin VB.Label lblLink 
  31.       Alignment       =   2  'Center
  32.       BackStyle       =   0  'Transparent
  33.       Caption         =   "www.ByAlexV.com"
  34.       BeginProperty Font 
  35.          Name            =   "Verdana"
  36.          Size            =   8.25
  37.          Charset         =   0
  38.          Weight          =   700
  39.          Underline       =   -1  'True
  40.          Italic          =   0   'False
  41.          Strikethrough   =   0   'False
  42.       EndProperty
  43.       ForeColor       =   &H8000000D&
  44.       Height          =   195
  45.       Left            =   60
  46.       MouseIcon       =   "About1.frx":3177
  47.       MousePointer    =   99  'Custom
  48.       TabIndex        =   4
  49.       Top             =   1740
  50.       Width           =   2835
  51.    End
  52.    Begin VB.Label lblVersion 
  53.       Alignment       =   2  'Center
  54.       BackStyle       =   0  'Transparent
  55.       Caption         =   "Version 1.0 Beta"
  56.       BeginProperty Font 
  57.          Name            =   "Verdana"
  58.          Size            =   8.25
  59.          Charset         =   0
  60.          Weight          =   700
  61.          Underline       =   0   'False
  62.          Italic          =   0   'False
  63.          Strikethrough   =   0   'False
  64.       EndProperty
  65.       Height          =   195
  66.       Left            =   60
  67.       TabIndex        =   3
  68.       Top             =   1020
  69.       Width           =   2850
  70.    End
  71.    Begin VB.Label Label2 
  72.       BackStyle       =   0  'Transparent
  73.       Caption         =   "VBSFC Form Animator"
  74.       BeginProperty Font 
  75.          Name            =   "Verdana"
  76.          Size            =   12
  77.          Charset         =   0
  78.          Weight          =   700
  79.          Underline       =   0   'False
  80.          Italic          =   -1  'True
  81.          Strikethrough   =   0   'False
  82.       EndProperty
  83.       ForeColor       =   &H000000FF&
  84.       Height          =   375
  85.       Left            =   50
  86.       TabIndex        =   2
  87.       Top             =   1370
  88.       Width           =   2895
  89.    End
  90.    Begin VB.Label Label1 
  91.       BackStyle       =   0  'Transparent
  92.       Caption         =   "VBSFC Form Animator"
  93.       BeginProperty Font 
  94.          Name            =   "Verdana"
  95.          Size            =   12
  96.          Charset         =   0
  97.          Weight          =   700
  98.          Underline       =   0   'False
  99.          Italic          =   -1  'True
  100.          Strikethrough   =   0   'False
  101.       EndProperty
  102.       ForeColor       =   &H00000000&
  103.       Height          =   375
  104.       Left            =   60
  105.       TabIndex        =   1
  106.       Top             =   1380
  107.       Width           =   2895
  108.    End
  109.    Begin ComctlLib.ImageList Backgrounds 
  110.       Left            =   2340
  111.       Top             =   2400
  112.       _ExtentX        =   1005
  113.       _ExtentY        =   1005
  114.       BackColor       =   -2147483643
  115.       ImageWidth      =   200
  116.       ImageHeight     =   200
  117.       MaskColor       =   12632256
  118.       _Version        =   327682
  119.       BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
  120.          NumListImages   =   10
  121.          BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  122.             Picture         =   "About1.frx":32C9
  123.             Key             =   ""
  124.          EndProperty
  125.          BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  126.             Picture         =   "About1.frx":D35B
  127.             Key             =   ""
  128.          EndProperty
  129.          BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  130.             Picture         =   "About1.frx":173ED
  131.             Key             =   ""
  132.          EndProperty
  133.          BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  134.             Picture         =   "About1.frx":2147F
  135.             Key             =   ""
  136.          EndProperty
  137.          BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  138.             Picture         =   "About1.frx":2B511
  139.             Key             =   ""
  140.          EndProperty
  141.          BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  142.             Picture         =   "About1.frx":355A3
  143.             Key             =   ""
  144.          EndProperty
  145.          BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  146.             Picture         =   "About1.frx":3F635
  147.             Key             =   ""
  148.          EndProperty
  149.          BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  150.             Picture         =   "About1.frx":496C7
  151.             Key             =   ""
  152.          EndProperty
  153.          BeginProperty ListImage9 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  154.             Picture         =   "About1.frx":53759
  155.             Key             =   ""
  156.          EndProperty
  157.          BeginProperty ListImage10 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  158.             Picture         =   "About1.frx":5D7EB
  159.             Key             =   ""
  160.          EndProperty
  161.       EndProperty
  162.    End
  163. End
  164. Attribute VB_Name = "frmAbout"
  165. Attribute VB_GlobalNameSpace = False
  166. Attribute VB_Creatable = False
  167. Attribute VB_PredeclaredId = True
  168. Attribute VB_Exposed = False
  169. Option Explicit
  170. Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
  171. Private Declare Function CreateRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  172. Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
  173. Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  174. Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
  175. Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  176. Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
  177. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  178. Private Declare Function ReleaseCapture Lib "user32" () As Long
  179. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  180. Private Type POINTAPI
  181.    X As Long
  182.    Y As Long
  183. End Type
  184. Private Const RGN_COPY = 5
  185. Private Const CreatedBy = "VBSFC 6"
  186. Private Const RegisteredTo = "Not Registered"
  187. Private ResultRegion As Long
  188.  
  189. Private Sub cmdOK_Click()
  190.     Unload Me
  191. End Sub
  192.  
  193. Private Sub Form_Load()
  194.     Dim nRet As Long
  195.     nRet = SetWindowRgn(Me.hwnd, CreateFormRegion(0, 1, 1, 0, 0), True)
  196.     'If the above two lines are modified or moved a second copy of
  197.     'them may be added again if the form is later Modified by VBSFC.
  198.     lblVersion.Caption = "Version " + CStr(App.Major) + "." + CStr(App.Minor) + " Beta"
  199. End Sub
  200. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  201. 'Next two lines enable window drag from anywhere on form.  Remove them
  202. 'to allow window drag from title bar only.
  203.     ReleaseCapture
  204.     SendMessage Me.hwnd, &HA1, 2, 0&
  205. End Sub
  206. Private Sub Form_Unload(Cancel As Integer)
  207.     DeleteObject ResultRegion
  208.     'If the above line is modified or moved a second copy of it
  209.     'may be added again if the form is later Modified by VBSFC.
  210. End Sub
  211. Private Function CreateFormRegion(Anim As Double, ScaleX As Single, ScaleY As Single, OffsetX As Integer, OffsetY As Integer) As Long
  212.     Dim HolderRegion As Long, ObjectRegion As Long, nRet As Long, Counter As Integer
  213.     Dim PolyPoints() As POINTAPI
  214.     ResultRegion = CreateRectRgn(0, 0, 0, 0)
  215.     HolderRegion = CreateRectRgn(0, 0, 0, 0)
  216.  
  217. 'This function has been modified by Form Animator for VB Shaped Form Creator
  218. 'Modifing this form in VB Shaped Form Creator will loose animation.  If you
  219. 'have to change this form then you must re-animate it using Form Animator.
  220.  
  221. 'Latest versions of VB Shaped Form Creator can be found at my website at
  222. 'http://www.comports.com/AlexV/VBSFC.html or you can visit my main site
  223. 'with many other free programs and utilities at http://www.comports.com/AlexV
  224.  
  225. 'Lines starting with '! are required for reading the form shape using the
  226. 'Import Form command in VB Shaped Form Creator, but are not necessary for
  227. 'Visual Basic to display the form correctly.
  228.  
  229. '!Shaped Form Region Definition
  230. '!3,0,55,145,200,0,0,1
  231.     ObjectRegion = CreateEllipticRgn((55 + Anim * -55) * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX, (0 + Anim * 0) * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY, (145 + Anim * 55) * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX, (200 + Anim * 0) * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY)
  232.     nRet = CombineRgn(ResultRegion, ObjectRegion, ObjectRegion, RGN_COPY)
  233.     DeleteObject ObjectRegion
  234. '!3,55,0,200,145,0,0,1
  235.     ObjectRegion = CreateEllipticRgn((0 + Anim * 0) * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX, (55 + Anim * -55) * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY, (200 + Anim * 0) * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX, (145 + Anim * 55) * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY)
  236.     nRet = CombineRgn(HolderRegion, ResultRegion, ResultRegion, RGN_COPY)
  237.     nRet = CombineRgn(ResultRegion, HolderRegion, ObjectRegion, 2)
  238.     DeleteObject ObjectRegion
  239.     DeleteObject HolderRegion
  240.     CreateFormRegion = ResultRegion
  241. End Function
  242.  
  243. Private Sub ExampleAnimate(NumSteps As Integer, Direction As Integer)
  244.     'Direction= 1 for forwards, -1 for backwards
  245.     Dim iStep As Double
  246.                 '0 to 1 for forwards, 1 to 0 for backwards
  247.     For iStep = -(Direction - 1) / 2 To (1 + Direction) / 2 Step (1 / NumSteps) 'Step from 0% animation to 100% animation in NumSteps
  248.         DeleteObject ResultRegion
  249.         SetWindowRgn Me.hwnd, CreateFormRegion(iStep, 1, 1, 0, 0), True
  250.         Stop
  251.     Next iStep
  252.     Stop
  253. End Sub
  254.  
  255. Private Sub lblLink_Click()
  256.     ShellExecute Me.hwnd, "open", "http://www.comports.com/AlexV/VBSFC.html", "", "", 1
  257. End Sub
  258.  
  259. Private Sub tmrAnimate_Timer()
  260.     Const NumFrames = 9
  261.     Static iFrame As Integer, Direction As Integer
  262.     If Direction = 0 Then Direction = 1
  263.     
  264.     DeleteObject ResultRegion
  265.     SetWindowRgn Me.hwnd, CreateFormRegion(CDbl(iFrame / NumFrames), 1, 1, 0, 0), True
  266.     Me.Picture = Backgrounds.ListImages(iFrame + 1).Picture
  267.     iFrame = iFrame + Direction
  268.     If iFrame < 0 Then iFrame = 0: Direction = 1
  269.     If iFrame > NumFrames Then iFrame = NumFrames: Direction = -1
  270. End Sub
  271.